#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int arr[N];
set<int> a;

int main() {
	int n;
	cin >> n;
	for (int i = 0 ; i < n; ++ i) {
		cin >> arr[i];
		a.insert(arr[i]);
	}
	cout << a.size() << endl;
	while (a.size()) {
		int x = *a.begin();
		a.erase(a.begin());
		cout << x << ' ';

	}
	return 0;
}